#pragma once
#ifdef WIN32
#include <Windows.h>
#endif

#include <stdlib.h>
#include <stdio.h>
#include <string>
#include <memory>

#define SAFE_DEL(a)				{ if(a) { delete (a); a=NULL; } }
#define SAFE_DELETE_ARRAY(a)	{ if(a) { delete [] (a); a=NULL; } }
#define SAFE_DEL_ARRAY(p, n)	{ if(p) { for (int __i = 0; __i < n;__i++) SAFE_DELETE_ARRAY((p)[__i]); delete[] (p); p = NULL; } }

#define NULL 0

typedef unsigned char			u8;
typedef char					s8;
typedef unsigned short			u16;
typedef short					s16;
typedef unsigned int			u32;
typedef int						s32;
typedef unsigned long long		u64;
typedef long long				s64;


struct Point3f
{
	float x;
	float y;
	float z;
	Point3f() : x(0.0f), y(0.0f), z(0.0f) {};
	Point3f(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {};
	~Point3f() {};

	const Point3f operator + (float delta);
	const Point3f AddX(float delta); // create a new Point3f which added delta at X, or Y, or Z.
	const Point3f AddY(float delta);
	const Point3f AddZ(float delta);

	Point3f& operator += (float delta);
	Point3f& IncX(float delta);
	Point3f& IncY(float delta);
	Point3f& IncZ(float delta);
};